package com.weseal.utils;

import org.springframework.context.ApplicationContext;

/**
 * @author weseal
 * @title
 * @description
 * @usage
 * @copyright Copyright 2014  rrmj Corporation. All rights reserved.
 * @company 上海众多美网络科技有限公司
 * @create 2017/9/12
 */
public class SpringContextUtil {

	private static ApplicationContext applicationContext;

	public static ApplicationContext getApplicationContext() {
		return SpringContextUtil.applicationContext;
	}

	public static void setApplicationContext(ApplicationContext applicationContext) {
		SpringContextUtil.applicationContext = applicationContext;
	}

	public static <T> T getBean(String beanName) {
		return (T) applicationContext.getBean(beanName);
	}
}
